﻿namespace LoveMusic.Models
{
    using System;
    using LoveMusic;
    using System.Collections.Generic;
    using LoveMusic.Helpers;

    /// <summary>
    /// Data Acess Interface.
    /// </summary>
    public interface IDataContext : IDisposable
    {
        /// <summary>
        /// Gets the categories.
        /// </summary>
        /// <returns></returns>
        Category[] GetCategories();
        /// <summary>
        /// Gets the html in string format for the type in the CMS table
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        String GetValue(string type);
        /// <summary>
        /// Deletes the specific story based on the id
        /// </summary>
        /// <param name="storyId"></param>
        void DeleteStory(int storyId);
        /// <summary>
        /// Gets the category for the specified name.
        /// </summary>
        /// <param name="categoryName">Name of the category.</param>
        /// <returns></returns>
        Category GetCategoryByName(string categoryName);

        /// <summary>
        /// Gets the tag for the specified name.
        /// </summary>
        /// <param name="tagName">Name of the tag.</param>
        /// <returns></returns>
        Tag GetTagByName(string tagName);

        /// <summary>
        /// Gets the top tags.
        /// </summary>
        /// <param name="top">The top.</param>
        /// <returns></returns>
        TagItem[] GetTags(int top);

        /// <summary>
        /// Gets the story detail by id.
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="storyId">The story id.</param>
        /// <returns></returns>
        StoryDetailItem Detail(Guid userId, int storyId);

        /// <summary>
        /// Gets the published stories for all category.
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="start">The start.</param>
        /// <param name="max">The max.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        StoryListItem[] GetSongsForAllCategory(Guid userId, int start, int max, out int total);

        /// <summary>
        /// Gets the 10 most voted published stories for all category in last 7 days 
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="start">The start.</param>
        /// <param name="max">The max.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        StoryListItem[] GetTop10All(Guid userId, int start, int max, out int total);

        /// <summary>
        /// Gets the 10 most voted published stories for a specific category in last 7 days 
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="start">The start.</param>
        /// <param name="max">The max.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        StoryListItem[] GetTop10Category(Guid userId, int categoryId, int start, int max, out int total);

        /// <summary>
        /// Gets the published stories for the specified category.
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="categoryId">The category id.</param>
        /// <param name="start">The start.</param>
        /// <param name="max">The max.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        StoryListItem[] GetSongsForCategory(Guid userId, int categoryId, int start, int max, out int total);

        /// <summary>
        /// Gets the stories for the specified tag.
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="tagId">The tag id.</param>
        /// <param name="start">The start.</param>
        /// <param name="max">The max.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        StoryListItem[] GetStoriesForTag(Guid userId, int tagId, int start, int max, out int total);

        /// <summary>
        /// Gets the upcoming stories.
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="start">The start.</param>
        /// <param name="max">The max.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        StoryListItem[] GetUpcomingStories(Guid userId, int start, int max, out int total);

        /// <summary>
        /// Gets the Top10 for upcoming stories in last 7 days
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="start">The start.</param>
        /// <param name="max">The max.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        StoryListItem[] GetUpcomingStoriesTop10(Guid userId, int start, int max);

        /// <summary>
        /// Gets the stories posted by the specified user.
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="postedByUserId">The posted by user id.</param>
        /// <param name="start">The start.</param>
        /// <param name="max">The max.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        StoryListItem[] GetStoriesPostedByUser(Guid userId, Guid postedByUserId, int start, int max, out int total);

        /// <summary>
        /// Searches the stories.
        /// </summary>
        /// <param name="userId">The currently visiting user id.</param>
        /// <param name="query">The query.</param>
        /// <param name="start">The start.</param>
        /// <param name="max">The max.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        StoryListItem[] SearchStories(Guid userId, string query, string searchType, int start, int max, out int total);

        StoryListItem[] SearchSong(Guid userId, string query, int start, int max, out int total);
        /// <summary>
        /// Submit the story.
        /// </summary>
        /// <param name="url">The URL.</param>
        /// <param name="title">The title.</param>
        /// <param name="categoryId">The category id.</param>
        /// <param name="description">The description.</param>
        /// <param name="tags">The tags.</param>
        /// <param name="userId">The user id who is submitting the stroy.</param>
        /// <param name="artistName">Name of the artist</param>
        /// <param name="documentName">Document Name</param>
        /// <param name="imageName">Image name</param>
        /// <param name="youTube">YouTube embeded code</param>
        /// <returns>Returns the id of the new story</returns>
        int SubmitStory(string songTitle, string artistName, int categoryId, string description, string tags, List<String> fileUrl, string youTubeID, Guid userId, string youTubeDescription);

        int SubmitStoryBot(string songTitle, string artistName, int categoryId, string description, string tags, List<String> fileUrl, string youTubeID, Guid userId, string youTubeDescription);

        bool StoryExists(string artistName, string songTitle);

        void SubmitText(string type, string value);

        /// <summary>
        /// Loves the specified story.
        /// </summary>
        /// <param name="storyId">The story id.</param>
        /// <param name="userId">The user id who is loving the story.</param>
        /// <param name="qualifyingLove">The qualifying number of love votes which is considered to mark a story as published.</param>
        void LoveStory(int storyId, Guid userId, int qualifyingLove);

        /// <summary>
        /// Post comments for the specified story.
        /// </summary>
        /// <param name="storyId">The story id.</param>
        /// <param name="userId">The user id who is posting the comment.</param>
        /// <param name="content">The content.</param>
        /// <returns>Returns the id of the new comment</returns>
        int PostComment(int storyId, Guid userId, string content);

        MP3FILE GetMp3UrlByID(int ID);

        void Save();

        string Sitemap();

        ArtistDetailItem GetArtistDetailByName(Guid userId, string artistName);

        IEnumerable<ARTIST> GetAllArtists();

        void SetArtistProbablyNotValidFlag(ARTIST artist);

        void InsertAllMusicBin(ref AllMusicBin allMusicBin, ref ARTIST artist);

        void InsertEchoBin(ref EchoArtistBin echoBin, ref ARTIST artist);

        int SubmitStoryBotArtist(string songTitle, string artistName, int storyCategoryId, string storyDescription, string tags, List<string> list, string encodingCode, string videoID, string imageURL, bool hasImage, Guid guid, string youTubeDescrption);

        int SubmitStoryBotArtistPoor(string songTitle, string artistName, int artistIDZ, int categoryId, string description, Guid userId, int? year);

        IEnumerable<ARTIST> GetAllArtistsThatAreNotUpdated();

        ArtistDetailItem CreateArtistFromSimilar(Guid userID, string artistName);

        ARTIST GetOneArtistNotUpdated();

        IEnumerable<Story> GetStoriesNotUpdated();

        IEnumerable<Story> GetStoriesNotUpdatedSortedBack();

        IEnumerable<Story> GetStoriesNotUpdatedSortedBackSkip();

        void SubmitSongWithMp3AndVideo(int storyID, List<String> mp3List, string encodingCode, string videoID, string tags, string youTubeDescrption);

        IEnumerable<Story> GetStoriesNotUpdatedSkip(int skip);

        IEnumerable<Story> GetStoriesNotUpdatedSkip(int skip, int take);

        IEnumerable<Story> GetStoriesForStack(int take);

        IEnumerable<Story> GetAllSongs();

        //   IEnumerable<aspnet_User> GetAllUsers();




        IEnumerable<ARTIST> GetAllArtistsThanUrlContains(string str);

        void InsertImage(IMAGE item);

        ARTIST GetArtistByName(string artistName);

        IMAGE GetImage(int imageID);

        void SetArtistStatus(int artistID, int status);

        StoryListItem[] GetStoriesForTag(Guid CurrentUserId, string name, int p, int _storyPerPage, out int total);

        StoryListItem[] GetStoriesPostedByUser(Guid CurrentUserId, string name, int p, int _storyPerPage, out int total);

        List<SongSmallBin> GetSongs(int storyId, int artistId);

        void DeleteMp3(MP3FILE mp3File);

        StoryListItem[] SearchMoods(string moodList,int weight, Guid CurrentUserId, int p, int _storyPerPage, out int total);

        StoryListItem[] SearchMoodsVideo(string moodList, int weight, Guid CurrentUserId, int p, int _storyPerPage, out int total);
        
        StoryListItem[] GetSongsMoodsCategory(string moodList, Guid CurrentUserId, int p, int p_2, int _storyPerPage, out int total);

        List<MP3FILE> Getallmp3(int storyID);

        List<CloudHolder> AllMoods();

        List<CloudHolder> Get50Artist();

        List<CloudHolder> Get50Songs();

    }
}
